package blueBridgeCup;

import java.util.Scanner;

public class demo11 {
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        int N= in.nextInt();
        int Q= in.nextInt();
        long []arr=new long[N+1];
        for (int i = 1; i <=N ; i++) {
            arr[i]=in.nextInt();
        }
        for (int i = 0; i <Q ; i++) {
            int left= in.nextInt();
            int right=in.nextInt();
            int t= in.nextInt();
            for (int j = left; j <=right ; j++) {
                arr[j]+=t;
            }
        }
        for (int i = 1; i <=N ; i++) {
            System.out.print((arr[i]<0?0:arr[i])+" ");
        }
    }

}
